/**
 * 
 */
package fr.gfi.agraf.utils;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author Zakaria
 * 
 */
public final class SpringFactory {

	/**
     * 
     */
	private static ApplicationContext applicationContext = null;

	/**
     * 
     */
	private SpringFactory() {
		// empty
	}

	/**
	 * @return the applicationContext
	 */
	public static ApplicationContext getApplicationContext() {
		synchronized (SpringFactory.class) {
			if (applicationContext == null) {
				applicationContext = new ClassPathXmlApplicationContext(
						"applicationContext.xml");
			}
			return applicationContext;
		}
	}

}
